import {
  ajaxPost
} from "@/api/ajax"

const state = {
  roles: [],
}

const mutations = {
  set_role_select(state, list) {
    state.roles = list;
  }
}

const actions = {
  getRoleSelect({
    commit
  }) {
    ajaxPost("role/options").then(res => {
      if (res.data) {
        
        commit('set_role_select', res.data);
      }
    })
  }
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
